<template>
  <el-form :model="form" label-width="auto" style="max-width: 600px">
    <el-form-item label="标题"  required>
      <el-input v-model="form.name" placeholder="这是项目标题" />
    </el-form-item>

    <el-form-item label="内容简介">
      <el-input v-model="form.desc" type="textarea"  placeholder="这是内容简介"/>
    </el-form-item>

    <el-form-item label="创建时间">
      <el-col :span="11">
        <el-date-picker
          v-model="form.date1"
          type="date"
          placeholder="2024-10-24 "
          style="width: 100%"
        />
      </el-col>
      
    </el-form-item>

    <el-form-item label="省份">
      <el-checkbox-group v-model="form.type">
        <el-checkbox value="Online activities" name="type" checked>
          贵州省
        </el-checkbox>
        <el-checkbox value="Promotion activities" name="type">
          四川省
        </el-checkbox>
        <el-checkbox value="Offline activities" name="type">
         云南省
        </el-checkbox>
        <el-checkbox value="Simple brand exposure" name="type" checked>
         重庆市
        </el-checkbox>
      </el-checkbox-group>
    </el-form-item>
    <el-form-item label="性别">
      <el-radio-group v-model="radio">
        <el-radio :value="1" >男</el-radio>
        <el-radio :value="2">女</el-radio>
      </el-radio-group>
    </el-form-item>

    <el-form-item label="公司"  >
      <el-input v-model="form.company" placeholder="公司" />
    </el-form-item>
    
    <el-form-item>
      <el-button type="primary" @click="onSubmit">提交数据</el-button>
      <el-button>取消</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang="ts" setup>
import { reactive,ref } from 'vue'
const radio = ref(1)
// do not use same name with ref
const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  company: '',
  desc: '',
})

const checked1 = ref(true)

const onSubmit = () => {
  console.log('submit!')
}
</script>
